<!doctype html>
<include file="Public:header"/>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<title><{$webData.title}></title>
		<script src="__PUBLIC__/Js/jquery-1.8.3.js"></script>
		<link rel="stylesheet" type="text/css" href="__PUBLIC__/Home/Css/index_index.css">
		<script>
		$(function(){
			// 用户名获得焦点时的JS代码
			$("#loginuser").focus(function(){
				$('#name').css('border', '#B24422 1px solid');
				$('#nameimg').attr('src', '__PUBLIC__/Home/Imgs/20140106114505.jpg');
				$(this).css({'outline':'none','color':'black'});
			});
			// 用户名失去焦点时的JS代码
			$("#loginuser").blur(function(){
				$('#name').css('border', '#DEDEDE 1px solid');
				$('#nameimg').attr('src', '__PUBLIC__/Home/Imgs/20140106114606.jpg');
				$(this).css({'outline':'none','color':'#666666'});
			});
			// 密码框获得焦点时的JS代码
			$("input[name=userpwd2]").focus(function(){
			    $(this).hide();
			    $("#login_password_index").show().focus();
				$('#pwd').css('border', '#B24422 1px solid');
				$('#pwdimg').attr('src', '__PUBLIC__/Home/Imgs/20140106114542.jpg');
				$(this).css({'outline':'none', 'color':'#666666'});
			});
			$("#login_password_index").focus(function(){
				$('#pwd').css('border', '#2EA574 1px solid');
				$('#pwdimg').attr('src', '__PUBLIC__/Home/Imgs/20140106114542.jpg');
				$(this).css({'outline':'none', 'color':'black'});
			});
			// 密码框失去焦点时的JS代码
			$("#login_password_index").blur(function(){
				$('#pwd').css('border', '#DEDEDE 1px solid');
				$('#pwdimg').attr('src', '__PUBLIC__/Home/Imgs/20140106114642.jpg');
				$(this).css('color', '#ccc');

				if ($(this).val() == "") { 
		          			$("input[id=loginpwd]").show(); 
		          			$("input[name=userpwd]").hide(); 
         				} 
			});

			/* 图片轮播开始 */
			var pic = 0;
			
			timer = setInterval(function(){
				var length = $('#right_l input').length;
				
				pic++;				
				pic = pic>length?0:pic;

				var imgurl = $('#right_l input:eq('+pic+')').val();
				var id = $('#right_l input:eq('+pic+')').attr('class');
				var url = '__APP__/Foods/details/id/'+id;
				$('#right_l img').attr({src:imgurl});
				$('#right_l a').attr({href:url});					
			},3000);
			/* 图片轮播结束 */

			/*添加到购物车Ajax*/
			$('.addCarts').click(function(){
				
				var fid = $(this).attr('alt');				
				var url = '__APP__/Carts/setCarts/';
				var nowobj = $(this);
				$.post(url,{id:fid},function(cdata){

					if('YES' == cdata.data){
	                                                	
	                                            	nowobj.text('已添加');
	                                        	}else if('NO' == cdata.data){
	                                        		nowobj.text('已存在');                   		
	                                        	}else{                                      		
	                                        		if(!confirm('您还没有登录,去登录吗?')){
                                    				return false;
                                				}
	                                        		window.location.href = "__APP__/Login/login";
	                                        	}

				});
			});

		});
		</script>
	</head>
	<body>		
		<div id="index_main">
			<!-- main left start -->
			<div id="main_left">
				<div id="left_l">
					<ul>						
						<volist name="cdata" id="bo">
						<li>				
							<a href="__APP__/Bclass/index/id/<{$bo.id}>" class="foods_type" title="<{$bo.bname}>" alt="<{$bo.id}>">
							<{$bo.bname}>
							</a>
						</li>
						</volist>
						<li>
							<a href="__APP__/Bclass/index/" class="foods_type" title="查看更多分类信息">更多...</a>
						</li>
					</ul>
					<div style="clear:both;height:30px;"></div>
					<a href="__APP__/Bclass/index/" id="index_sclass">全部菜谱分类</a>
				</div>

				<div id="right_l">
					<a href="__APP__/Foods/details/id/<{$favdata[0]['id']}>"><img src="__ROOT__/Uploads/Foods/<{$favdata[0]['pic']}>" width="518" height="300" /></a>
					<volist name="favdata" id="favvo">
						<input type="hidden" class="<{$favvo.id}>" value="__ROOT__/Uploads/Foods/<{$favvo.pic}>">
					</volist>
				</div>
				<div class="clear_both"></div>
				<div class="nav_top">
					<span style="color:#909090">新品上架</span>
					<a href="__APP__/Sclass/getFoods/opr/new/" target="__blank">
						<font style="margin-left:10px;color:#B24422;font-size:14px;">
							查看全部
						</font>
					</a>
				</div>
				<div id="xinxiu_img">					
					<volist name="newfoods" id="nvo">
						<div class="newfoods">
							<a href="__APP__/Foods/details/id/<{$nvo.id}>">
								<img src="__ROOT__/Uploads/Foods/thumb/th_<{$nvo.pic}>" width="120" height="80">
							</a>
							<font style="font-size:14px;"><{$nvo.name}></font><br />
							<p style="font-size:12px;color:#909090">
								价格：<{$nvo.price}>￥
							</p>
							<font style="margin-left:5px;color:#909090;font-size:12px;">
								<a alt="<{$nvo.id}>" class="addCarts">
									+购物车
								</a>
							</font>	
						</div>
					</volist>					
				</div>
				<div style="height:50px;clear:left;margin-left:28px;"></div>

				<div style="width:500px;height:30px;float:right;margin-right:16px;">
					<span style="color:#909090">最近流行</span>&nbsp;&nbsp;&nbsp;
					<!-- <a href=""><font style="color:#B24422;font-size:14px;">全部</font></a> -->
				</div>
				
				<!-- 循环遍历结果 -->
				<div id="nav_cen">
					<volist name="foodsdata" id="fovo">
						<div style="width:150px;height:auto;overflow:hidden;float:left;margin-right:22px;margin-top:30px;">
							<a href="__APP__/Foods/details/id/<{$fovo.id}>"><img src="__ROOT__/Uploads/Foods/<{$fovo.pic}>" width="150" height="120"></a><br>
							<font style="font-size:14px;color:#B24422"><{$fovo.name}></font><br>
							<font style="font-size:12px;color:#909090">
								价格：<{$fovo.price}>￥
							</font>
							<font style="margin-left:10px;color:#909090;font-size:12px;">
								<a alt="<{$fovo.id}>" class="addCarts">
									+购物车
								</a>
							</font>
						</div>				
					</volist>
					<div style="clear:both;height:20px;"></div>
				</div>

				<div style="clear:both;height:20px;"></div>
					

				<!-- center bottom start -->
				<!-- <div style="width:650px;min-height:100px;">
					<div style="float:left;width:650px;height:100px;line-height:100px;color:#333333;font-size:18px;background:#DAD6D0;">
						<div style="margin-left:50px;">共有<span style="color:#EC6C3F;"><{$foodTotal}></span>道菜供您选择<span style="float:right;margin-top:6px;"><img src="__PUBLIC__/Home/Imgs/girl.jpg"></span>
						</div>
						
					</div> -->
					<!-- 循环遍历结果 -->
					
					<!-- <a href="">
					<div style="float:left;margin-top:5px;width:650px;height:100px;background:#E8E6E3">
						<div style="float:left;width:300px;height:100px;margin-left:20px;">
							<div style="margin-top:20px;color:#992222;height:20px;line-height:20px;">#烘烤蛋糕#</div>
							<div style="color:#909090;font-size:12px;height=25px;line-height:25px;">最幸福的瞬间莫过于，打开蛋糕盒，闻到蛋糕的香气...</div>
						</div>
						<div style="float:left;width:300px;height:100px;">
							<div style="float:right;margin-top:10px;"><img src="__PUBLIC__/Home/Imgs/cake.jpg"></div>
						</div>
					</div>
					</a>-->
				<!-- </div>  -->
				<!-- center bottom end -->
			</div>
			<!-- main left end -->


			<!-- main right start -->
			<div id="main_right">
				<div id="margin_right_top">
					<empty name="Think.session.uname">
						<form action="__APP__/Login/checkLogin/" method="post">
						<table width="250" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td colspan="2">
									<div id="name">
									<img id="nameimg" src="__PUBLIC__/Home/Imgs/20140106114606.jpg" style="float:left;"/><input type="text" id="loginuser" name="username" value="邮箱/用户名" onfocus="if (value =='邮箱/用户名'){value =''}" onblur="if (value ==''){value='邮箱/用户名'}"></div>
								</td>
							</tr>
							<tr height="14">
								<td colspan="2">&nbsp;</td>
							</tr>
							<tr>
								<td colspan="2">
									<div id="pwd" style="width:250px;height:40px;line-height:40px;border:#DEDEDE 1px solid;">
									<img id="pwdimg" src="__PUBLIC__/Home/Imgs/20140106114642.jpg" style="float:left;"/>
									<input type="text" id="loginpwd" name="userpwd2" value="密码" style="width:212px;height:40px;float:left;border:none;outline:none;color:#666666">
									<input type="password" name="userpwd" id="login_password_index" style="width:212px;height:40px;float:left;border:none;display:none;outline:none;color:#666666"/>
									</div>
								</td>
							</tr>
							<tr height="45" valign="middle">
								<td><label><input type="checkbox" name="jizhu"/>下次自动登录</label></td>
								<td align="right"><a href="__APP__/Login/safe/">忘记密码?</a></td>
							</tr>
							<tr>
								<td colspan="2">
									<input type="submit" value="登录" style="font-size:16px;color:white;border:none;background:#B24422;width:250px;height:40px;margin-top:10px;">
								</td>
							</tr>
						</table>
					</form>
					<else />
						<table width="90%" style="margin:10px 5%">
							<tr>
								<td></td>
								<td>
									<a href="__APP__/Ucenter/index/header" >
									<img src="__ROOT__/Uploads/Users/thumb/th_<{$Think.session.uheadpic}>" width="200" class="uheadpic"/>
									</a>
								</td>
								<td></td>
							</tr>
							<tr>
								<td></td>
								<td align="left" style="text-indent:3em;">
								用户名:<{$Think.session.uname}>
								</td>
								<td></td>
							</tr>
							<tr>
								<td></td>
								<td align="left" style="text-indent:3em;">
								积&nbsp;分:<{$Think.session.umoney}>
								</td>
								<td></td>
							</tr>
						</table>
					</empty>					
				</div>
				<div style="clear:both;height:30px;background:#F5F4F2;"></div>

				<div style="width:300px;height:250px;float:left;background:url(__PUBLIC__/Home/Imgs/20140122211754.jpg);"></div>
				
				<div style="clear:both;height:30px;background:#F5F4F2;"></div>

				<!-- 流行搜索开始 -->
				<div style="width:300px;height:220px;float:left;">
					<div style="clear:both;height:20px;"></div>
					<font style="margin-left:10px;color:#A7A5A3;">点击排行</font><br>
					<volist name="logdata" id="logvo">
						<div style="width:140px;float:left;margin-left:5px;margin-top:15px;font-size:14px;">
							<div style="width:20px;float:left;color:#909090">
								<!-- <font><{$i}></font> -->
							</div>
							<a href="__APP__/Foods/details/id/<{$logvo.fid}>">
								<font class="baicai">
									<{$logvo.name}>
								</font>
							</a>
							<span style="float:right;">
							<img src="__PUBLIC__/Home/Imgs/0.jpg" style="margin-left:5px;">
							</span>
						</div>
					</volist>
				</div>
				<!-- 流行搜索结束 -->

				<div style="clear:both;height:30px;background:#F5F4F2;"></div>
				
				<!-- 用户排行开始 -->
				<div style="width:300px;height:630px;float:left;">
					<div style="clear:both;height:20px;"></div>
					<font style="margin-left:20px;color:#A7A5A3;">用户排行</font>
					<!-- <a href=""><font style="margin-left:20px;color:#BD5E40;font-size:14px;">更多</font></a> -->
					
					<volist	 name="udata" id="uvo">
						<div class="headpic">
							<br />
							<img src="__ROOT__/Uploads/Users/thumb/th_<{$uvo.headpic}>" width="60" height="60"/>
							<font style="float:left;margin-left:5px;color:#992222"><{$uvo.username}></font>
							<br>
							<font style="margin-left:5px;color:#B2A5BB;font-size:14px;">积分:<{$uvo.money}></font><br>
							<!-- <font style="margin-left:5px;color:#B2A5BB;font-size:14px;">12个作品</font> -->
						</div>
					</volist>
					
				</div>
				<!-- <div style="width:300px;height:80px;text-align:center;line-height:80px;">
					<a href="">
						<font style="float:left;margin-left:120px;color:#992222;font-size:14px;">查看更多</font>
					</a>
				</div> -->
				<!-- 用户排行结束 -->
			</div>
			<!-- main right end  -->
		</div>
	</body>
</html>
<include file="Public:footer"/>